import abc
from typing import Iterator, Mapping

from .detached import DetachedJob
from .platform import Platform


class JobsAgency(abc.ABC):
    @property
    @abc.abstractmethod
    def platforms(self) -> Mapping[str, Platform]:
        pass

    @abc.abstractmethod
    def get_detached_job(self, job_id: str) -> DetachedJob | None:
        pass

    @abc.abstractmethod
    def iter_detached_jobs(self) -> Iterator[DetachedJob]:
        pass
